source enthalpy.tcl
Charmm create entropyCalculator 
entropyCalculator setup {
   dir entropy
   cmd charmm.inp
   output charmm.out
   compressOutput no
}
entropyCalculator start
entropyCalculator do {
    load rtf ~/simulation/common/toph19_eef1.1.gouy.inp
    load para ~/simulation/common/param19_eef1.1.gouy.inp
    load psf 2mag.psf
    load coor 2mag.crd
}
entropyCalculator setSolvent IMM1_memb
Traj create A entropyCalculator { pept_n1.dcd pept_n2.dcd  }
Traj create B entropyCalculator { pept_w1.dcd}
time {
set w1 {}
A eachframe {
 array set energy [ getEnergy ]
 lappend w1 $energy(ENER)
}
}
time {
set w2 {}
B eachframe {
  array set energy [ getEnergy ]
 lappend w2 $energy(ENER)
}
}
#set w1 { -500 -510 -550 -530}
#set w2 {-510 -520 -540 -520}
time {
puts "memb [llength $w1]:\n[ave $w1] [min $w1]"
puts "water [llength $w2]:\n[ave $w2] [min $w2]"
}

time {
puts [calcEnthalpy 298 $w1 $w2]
}
